package com.fqh.config;

import java.io.FileWriter;
import java.io.IOException;

/* *
 *类名：AlipayConfig
 *功能：基础配置类
 *详细：设置帐户有关信息及返回路径
 *修改日期：2017-04-05
 *说明：
 *以下代码只是为了方便商户测试而提供的样例代码，商户可以根据自己网站的需要，按照技术文档编写,并非一定要使用该代码。
 *该代码仅供学习和研究支付宝接口使用，只是提供一个参考。
 */

public class AlipayConfig {

//↓↓↓↓↓↓↓↓↓↓请在这里配置您的基本信息↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓

    // 应用ID,您的APPID，收款账号既是您的APPID对应支付宝账号
    public static String app_id = "2016092300578222";

    // 商户私钥，您的PKCS8格式RSA2私钥
    public static String merchant_private_key = "MIIEvAIBADANBgkqhkiG9w0BAQEFAASCBKYwggSiAgEAAoIBAQCLBU2BrICQAhCxLTRgEg/WMSDXV6tEVVr9fuqJQslXcvl1c6dkkQHi5G0jIy/euTAYCb2SZSQzIF7T6buh7fzUZ5qUgjY0k5p3FZjXkcLO/oHle3EZwO4O6txWySyun75DZxTIvTyUa9kz9b7IovuDpjuW0P5nH4WFoBuHvnKKsJE0oXPH02nQZyXQJQaVWO7sxhhvx1ybGouLK0bjvReYmrDJbJyP/97N++xnnMJRuyknBOFhYzxE5IdqXSOPE6Tybq6Q5r/kr+VXzfvyUBdmJ9oNKO85btFn4QzXjGqANI5YD/I6AxmWC4cidJMb5uZkAki/QE4QldJUTtm5k4JTAgMBAAECggEAOlhaZA7y0f2b5dA0CBHshZeO0fHgVkiAbJ2Eb2ERQVtmqM2GNmXJZeE6kKGm6JHORnhoEHXUUITIZ6XT8q0ADGEC9ksD1uMP0+TDhc2N9fPIrng1Snq3LpmRKfc6gntWjdFIXstVDnGI8g60KF6GsoTkw3IpIzyOfDtq8niSd/PnaxnZk1jzv1NOzKtAk0u3pNQp+hoyeG+fOzu+UuLxCOoOY3CB/CeWK7m+bFQd8R/dvz4x8NiRI3zzpE4fzmmM8gJKFwKFqJg07Y1s5SO7LngToXWf+DQIjdF4qIl6vzVb0Vgd+zM83Zh6MMxtMzF3CfgL7q+1iU9GpxIl/L3KuQKBgQD9NBhhh2RtVvwwYciNByxC6cZ98oT+1gKTTnx8Vqw6XXIi61GrciTdHXypAUuCyEEsZOKh+hp7Tp3UAUeV1OI+wGFT4T+8R94y6JDxT1dYRU9vQRL1X7TZcOob4i36ctpWrxdY+Beq3/mOMk6/MrCAKK4xn51OL5EvJxMeVOSiJwKBgQCMjl5Oiw4rdvqPuFYBADcf68TbYyZ+nn63ltWgNLCNTOzmdcn0SMahMl0yYpSAPWPrsmU/+unWSOWpIfpUFOPnCFpTVJxs5ZOJjwUZlDtzIavcmmQp1052C0qvTdM7zabOyXuBEuywN9405zA0nk9GnqphULouo6DVo1+95eP19QKBgFML3h9G3+p4yDg6KiQPQTYlJMQ0YeiPWsLj0DKb3ts5wPCxC9VWl76qKDPqR9D6S137LNYBiOP+kgdx7/+1lgsM4B851sSzMa6y1q8+3aAHA5my1zwBivhyb2Z71aa6OuCJhvfYTzLtSRWZbHiLcJZoQVHnTxnQwiacA0pEf8SrAoGAHSlIfakyBmiH8ZuAFHMT/MZwsEew6+I8TiC4L6Xe32IPYH0dqlYTB8yoM1TqlHSoL3VytkR7kV7MbzvCcQFoiz1baCCM17cF1itbFoR/lRJuUrWhhGDMQYd0NkzCP40aR5rbydrASos8yeMRSEl0DyXKGaijCBwguVJNAdwZYKUCgYBDa9aBuHKCvFCJEplK3dWxjzlvsyI0281PaacCF1UUua22mPJo9uVfSK27c0ExkdqLNrDuRxz/cY4gGFTArKYTnbJsxeIUjXO3XzkI0Swaz1MCXVvQs3cJmQ51dCC6V80DnZeyHViOGlml255WmUzAJAAYynXzqDu+f+1GnJUevA==";

    // 支付宝公钥,查看地址：https://openhome.alipay.com/platform/keyManage.htm 对应APPID下的支付宝公钥。
    public static String alipay_public_key = "MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAyR381fqjJZRZTjqoPHviaX3PcpoPmwlTDyP9W6erJc5mpyAQ22vO3nZGCeiVOQpfuDVEXO2bZzirsoNXDuBHs/zZppI37XtpYLnIAJ8fsTVwxGAV7ffn6VjTcNEfD30Ca9RIOqAdrZJJX/c++NiCjnlIBlf+olUxps34g1Gwf/Y4hvr8FLvwzcsvzqCsXZ/p+u27uO40wvt/PKkXVn9k0sG6sz+MjnuJYq1zVEUxDiyi16llAPiaUFPg/tmHsDTuXDy3/DXSLfUiTXOOxEwJBz+QeSiChNpE/mXzJL8uyjMoYdt+t787lNmyJACCOTUbIKlG+CIuY5xk6h6v/Zg3NwIDAQAB";

    // 服务器异步通知页面路径  需http://格式的完整路径，不能加?id=123这类自定义参数，必须外网可以正常访问
    public static String notify_url = "http://127.0.0.1:8080/Boheyuan_Portal_war_exploded/success.do";

    // 页面跳转同步通知页面路径 需http://格式的完整路径，不能加?id=123这类自定义参数，必须外网可以正常访问
    public static String return_url = "http://127.0.0.1:8080/Boheyuan_Portal_war_exploded/success.do";

    // 签名方式
    public static String sign_type = "RSA2";

    // 字符编码格式
    public static String charset = "utf-8";

    // 支付宝网关  https://openapi.alipaydev.com/gateway.do
    public static String gatewayUrl = "https://openapi.alipaydev.com/gateway.do";

    // 支付宝网关
    public static String log_path = "C:\\";


//↑↑↑↑↑↑↑↑↑↑请在这里配置您的基本信息↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑

    /**
     * 写日志，方便测试（看网站需求，也可以改成把记录存入数据库）
     *
     * @param sWord 要写入日志里的文本内容
     */
    public static void logResult(String sWord) {
        FileWriter writer = null;
        try {
            writer = new FileWriter(log_path + "alipay_log_" + System.currentTimeMillis() + ".txt");
            writer.write(sWord);
        } catch (Exception e) {
            e.printStackTrace();
        } finally {
            if (writer != null) {
                try {
                    writer.close();
                } catch (IOException e) {
                    e.printStackTrace();
                }
            }
        }
    }
}
